package com.github.chain.admin.server.service;

import com.github.chain.admin.common.domain.User;
import com.github.chain.admin.common.request.UserRequest;
import com.github.framework.core.Result;
import com.github.framework.core.page.DataPage;
import org.springframework.web.bind.annotation.RequestBody;

import java.lang.reflect.InvocationTargetException;
import java.util.List;

public interface UserService {
    /**
     * 根据用户名称查询用户
     * @param userName
     * @return
     */
    Result<User> findUserByUserName(String userName);

    /**
     * 用户分页查询
     * @param userRequest
     * @return
     */
    Result<DataPage<User>> findUserByPage(UserRequest userRequest);

    Result<User> findUserById(Long id);

    Result<Integer> saveUser(UserRequest userRequest);

    Result<Integer> updateUser(UserRequest userRequest);

    Result deleteUserById(Long id);

    Result<Integer> enableUserStatus(List<Long> ids);

    Result<Integer> disableUserStatus(List<Long> ids);

    Result<Integer> modifyUserPassword(UserRequest userRequest);

    Result<User> roleAssignmentById(Long id);

    Result<Integer> authUserRole(UserRequest userRequest);

}
